<?php
/**
 * 领域服务基础
 *
 * @date    2020-06-23 10:42:57
 * @version $Id$
 */

namespace App\Commons\Domain\Core;

abstract class DomainService
{
    protected $config = [];
    protected $ctx;

    public function __construct()
    {
        $key = defined('static::CONFIG') ? static::CONFIG : '';
        if ($key) {
            $this->config = config('services.'. $key);
        }
        $ctx = defined('static::CONTEXT') ? static::CONTEXT : '';
        if ($ctx) {
            $this->ctx = new $ctx;
        }
    }
}
